<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增防雷重点单位')" />
	<link th:href="@{/css/boot.css}" rel="stylesheet" />
	<link th:href="@{/css/city-picker.css}" rel="stylesheet"  />
	<script th:src="@{/js/jquery.m.js}"></script>
	<script th:src="@{/js/boot.js}"></script>
	<script th:src="@{/js/city-picker.data.js}"></script>
	<script th:src="@{/js/city-picker.js}"></script>
	<script th:src="@{/js/main.js}"></script>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-js" />
    <style>

		.label-error{
			position: absolute;
			right: 18px;
			top: 10px;
			color: #ef392b;
			font-size: 12px;
		}
    </style>
</head>



<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tJcFlzddw-add">
			<input name="createId" type="hidden" id="treeId"/>
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2  control-label"><span style="color: red">*
				</span>社会统一信用代码：</label>
						<div class="col-sm-10">
							<!--<input id="creditCode" name="creditCode" class="form-control" type="text"  required>-->
							<input  name="creditCode"  id="creditCode" placeholder="请输入社会统一信用代码"  class="form-control " type="text"   required >
							<!--<label id="repeat"  class="label-error" for="creditCode"><i class="fa fa-times-circle"></i> 重复</label>-->
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2  control-label"><span
								style="color: red">*
					</span>单位名称：</label>
						<div class="col-sm-10">
							<input id="unitName" name="unitName" placeholder="请输入单位名称" class="form-control" type="text" required>
							<!--<label id="creditCode-error1" class="error" for="creditCode" style="display: block;"></label>-->
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label"><span style="color: red">*
				</span>单位地址：</label>
						<div class="col-sm-10">
							<input id="unitAddress"
								   placeholder="请输入单位地址"name="unitAddress" class="form-control" type="text" required>
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">所属行政区：</label>
						<div class="col-sm-8">
							<input name="administrativeRegion" id="city-picker3" class="form-control" readonly type="text" value="山东省/济南市/历下区" data-toggle="city-picker">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">邮政编码：</label>
						<div class="col-sm-8">
							<input id="emailCode" name="emailCode" placeholder="请输入邮政编码"class="form-control" type="text">
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">行业属性：</label>
						<div class="col-sm-8">
							<select name="tradeProperty" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw')}">
								<option value="">请选择行业属性</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">防雷类别：</label>
						<div class="col-sm-8">
							<select name="thunderCategory" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_type')}">
								<option value="">请选择防雷类别</option>
								<option th:each="dict :${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">检测周期：</label>
						<div class="col-sm-8">
							<select name="searchCycle" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_time')}">
								<option value="">请输入检测周期</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">联系人：</label>
						<div class="col-sm-8">
							<input id="contacts" placeholder="请输入联系人" name="contacts" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">联系电话：</label>
						<div class="col-sm-8">
							<input id="contactsPhone" name="contactsPhone"placeholder="请输入联系电话" class="form-control" type="text">
						</div>
					</div>
				</div>
			</div>



			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">

					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">

					</div>
				</div>
			</div>


			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">安全负责人：</label>
						<div class="col-sm-8">
							<input id="securityPeople" name="securityPeople" class="form-control" placeholder="请输入安全负责人"type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">安全负责人联系电话：</label>
						<div class="col-sm-8">
							<input id="securityPeoplePhone" name="securityPeoplePhone" class="form-control" placeholder="请输入安全负责人联系电话" type="text">
						</div>
					</div>
				</div>
			</div>


			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">成立时间</label>
							<div class="col-sm-8">
								<input name="foundDate" type="text" class="form-control" id="laydate-demo-1" placeholder="请输入成立时间" />
							</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">经营状态：</label>
						<div class="col-sm-8">
							<select name="manageStaus" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_manage')}">
								<option value="">请输入经营状态</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>




			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">是否违规：</label>
						<div class="col-sm-8">
							<select name="violation" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_record')}">
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">数据来源：</label>
						<div class="col-sm-8">
							<select name="dataSource" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_source')}">
								<option value="">请选择数据来源</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label">备注：</label>
						<div class="col-sm-10">
					<textarea id="remark" name="remark" placeholder="请输入备注"
							  class="form-control" type="text"></textarea>
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
	<div class="row">
		<div class="col-sm-offset-5 col-sm-10">
			<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保存</button>&nbsp;
			<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		</div>
	</div>

    <script type="text/javascript">

		// $(function () {
		// 	$("#repeat").hide();
        //
        //
		// })
		// /*$("#repeat").blur(function () {
		// 	$("#repeat").hide();
		// })*/
		// function repeat(){
        //
		// 	$("#repeat").hide();
		// }

		var prefix = ctx + "system/tJcFlzddw"

		$("#laydate-demo-1").datetimepicker({
			format: "yyyy-mm-dd",
			minView: "month",
			autoclose: true
		});
		$("#form-tJcFlzddw-add").validate({

			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});



		function submitHandler() {
            // var creditCode = document.getElementById("creditCode").value;
            // $.ajax({
            //     url : ctx + "system/tJcFlzddw/judge",
            //     type:"post",
			// 	data:{"creditCode":creditCode},
            //     dataType :"json",
            //     success: function (data) {
            //        		if(data == -4) {
			// 				/*	getId.getAttributeNode("style").value ="display:block";
            //        			creditId.getAttributeNode("class").value = "form-control error";*/
			// 				// $("#repeat").show();
			// 				$("#creditCode").attr('class', 'form-control error');
            //
			// 			}else {

                   			// $("#repeat").hide();
							if ($.validate.form()) {
								var data = $("#form-tJcFlzddw-add").serializeArray();
								var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
								var roleIds = $.form.selectCheckeds("role");
								var postIds = $.form.selectSelects("post");
								data.push({"name": "status", "value": status});
								data.push({"name": "roleIds", "value": roleIds});
								data.push({"name": "postIds", "value": postIds});

								$.operate.saveTab(prefix + "/add", data);
							}
				// 		}
                //     }
                //
            	// });

		}
		/*/!*用户管理-新增-选择部门树*!/
		function selectDeptTree() {
			var treeId = $("#treeId").val();
			var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
			var url = ctx + "system/tJcFlzddwCount/selectDeptTree/" + deptId;
			var options = {
				title: '选择部门',
				width: "380",
				url: url,
				callBack: doSubmit
			};
			$.modal.openOptions(options);
		}
		function doSubmit(index, layero){

			var tree = layero.find("iframe")[0].contentWindow.$._tree;
			if ($.tree.notAllowParents(tree)) {
				var body = layer.getChildFrame('body', index);
				$("#treeId").val(body.find('#treeId').val());
				$("#treeName").val(body.find('#treeName').val());
				layer.close(index);
			}
		}*/
		function check() {
			$.ajax({
				url: ctx + "system/tjcFlzddw/judge",
				type:"post",
				dataType:"json",
				/*async: false,*/
				success:function (data) {
				}

			});
		}
	</script>


</body>
</html>
